#ifndef	DOCUMENT_APP_H_H_H_
#define DOCUMENT_APP_H_H_H_

#include "Observer.h"
#include "Persistence.h"
#include "Type.h"
#include "PropertyContainer.h"
#include "PropertyStandard.h"

#include <map>
#include <vector>
#include <stack>

#include <boost/signals.hpp>
#include <boost/graph/adjacency_list.hpp>


namespace App
{
	class DocumentObject;
}

// class tsss : public Base::BaseClass
// {
// 	//PROPERTY_HEADER(tsss);
// public:
// 	tsss();
// 
// };

class Document_App : App::PropertyContainer
{
	 PROPERTY_HEADER(Document_App);

public:
	/** @name Properties */
	//@{
	/// holds the long name of the document (utf-8 coded)
	App::PropertyString Label;
	/// full qualified (with path) file name (utf-8 coded)
	App::PropertyString FileName;
	/// creators name (utf-8)
	App::PropertyString CreatedBy;
	App::PropertyString CreationDate;
	/// user last modified the document
	App::PropertyString LastModifiedBy;
	App::PropertyString LastModifiedDate;
	/// company name UTF8(optional)
	App::PropertyString Company;
	/// long comment or description (UTF8 with line breaks)
	App::PropertyString Comment;
	/// Id e.g. Part number
	App::PropertyString Id;
	/// unique identifier of the document
	App::PropertyUUID   Uid;

public:
	Document_App(void);
	~Document_App(void);

	boost::signal<void(const App::DocumentObject&)>signalNewObject;
	boost::signal<void(const App::DocumentObject&)>signalActiveObject;

	boost::signal<void (Base::Writer   &)> signalSaveDocument;
	boost::signal<void (Base::XMLReader&)> signalRestoreDocument;
	boost::signal<void (const std::vector<App::DocumentObject*>&,
		Base::Writer   &)> signalExportObjects;
	boost::signal<void (const std::vector<App::DocumentObject*>&,
		Base::XMLReader&)> signalImportObjects;

	App::DocumentObject *getObject(const char *Name) const;

	const char *getObjectName(App::DocumentObject *pFeat) const;

	const char* getName()const;
	bool isTouched(){return true;}
	void recompute(){}

	bool save();

	bool isSaved()const;
	virtual void Save(Base::Writer &writer)const;
	virtual void Restore(Base::XMLReader &reader);


	App::DocumentObject* addObject(const char* sType,const char* pObjectName = 0);

	std::string getUniqueObjectName(const char* name)const;

	App::PropertyString TransientDir;

	void setFileValue(const char* value);

	void setlabelValue(const char*);

private:

	struct AppDocumentP* d;



};
#endif